package com.ln.adoms.entity;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.hibernate.validator.constraints.NotBlank;

import com.ln.core.orm.hibernate.BaseEntity;

@Entity
@Table(name = "department")
@JsonIgnoreProperties({"visible", "insertTime", "lastUpdateTime", "department", "type"})
public class Department extends BaseEntity {

    @NotBlank(message = "不能为空")
    private String name; // 部门名称
    @NotBlank(message = "不能为空")
    private String code; // 部门编号
    @NotBlank(message = "不能为空")
    private String addrArea; // 区域
    @NotBlank(message = "不能为空")
    private String addrRegion; // 县/区
    @NotBlank(message = "不能为空")
    private String addrCity; // 城市
    @NotBlank(message = "不能为空")
    private String addrProvince; // 省份
    @NotBlank(message = "不能为空")
    private String addrDetail; // 详细地址
    @NotBlank(message = "不能为空")
    private String contactor;// 责任人
    private String contactorPhone1;// 联系电话1
    private String contactorPhone2;// 联系电话2
    private String directShipper;// 物流名称
    private String roadMap; // 乘车路线

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "type_id")
    private DepartmentType type; // 部门类型

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "department_id")
    private Department department; // 上级部门

    //	@NotBlank(message = "不能为空")
    private String zipCode; // 邮编
    private String memo; // 备注

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getAddrArea() {
        return addrArea;
    }

    public void setAddrArea(String addrArea) {
        this.addrArea = addrArea;
    }

    public String getAddrRegion() {
        return addrRegion;
    }

    public void setAddrRegion(String addrRegion) {
        this.addrRegion = addrRegion;
    }

    public String getAddrCity() {
        return addrCity;
    }

    public void setAddrCity(String addrCity) {
        this.addrCity = addrCity;
    }

    public String getAddrProvince() {
        return addrProvince;
    }

    public void setAddrProvince(String addrProvince) {
        this.addrProvince = addrProvince;
    }

    public String getAddrDetail() {
        return addrDetail;
    }

    public void setAddrDetail(String addrDetail) {
        this.addrDetail = addrDetail;
    }

    public String getContactor() {
        return contactor;
    }

    public void setContactor(String contactor) {
        this.contactor = contactor;
    }

    public String getContactorPhone1() {
        return contactorPhone1;
    }

    public void setContactorPhone1(String contactorPhone1) {
        this.contactorPhone1 = contactorPhone1;
    }

    public String getContactorPhone2() {
        return contactorPhone2;
    }

    public void setContactorPhone2(String contactorPhone2) {
        this.contactorPhone2 = contactorPhone2;
    }

    public String getDirectShipper() {
        return directShipper;
    }

    public void setDirectShipper(String directShipper) {
        this.directShipper = directShipper;
    }

    public String getRoadMap() {
        return roadMap;
    }

    public void setRoadMap(String roadMap) {
        this.roadMap = roadMap;
    }

    public DepartmentType getType() {
        return type;
    }

    public void setType(DepartmentType type) {
        this.type = type;
    }

    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }

    public String getZipCode() {
        return zipCode;
    }

    public void setZipCode(String zipCode) {
        this.zipCode = zipCode;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

}